import java.util.Random;

public class Main {
    public static void main(String[] args) {
        Random rand = new Random();
        int count = 0;

        for (int i = 0; i < 10; i++) {
            for (int j = 0; j < 5; j++) {
                int a = rand.nextInt(100);
                int b;
                if (count % 2 == 0) {
                    do {
                        b = rand.nextInt(100);
                    } while (a + b > 100);
                    System.out.printf("%-2d + %-2d = %-2d\t", a, b, a + b);
                } else {
                    do {
                        b = rand.nextInt(101);
                    } while (b > a);
                    System.out.printf("%-2d - %-2d = %-2d\t", a, b, a - b);
                }

                count++;
            }
            System.out.println();
        }
    }
}